#include <iostream>
#include <deque>
#include <algorithm>
#include <time.h>

using namespace std;

void printDeque(const deque<int> d)
{
    for (deque<int>::const_iterator it = d.begin(); it != d.end(); ++it)
    {
        cout << (*it) << " ";
    }

    puts("");
}

void test01()
{

    deque<int> d;

    for (int i = 0; i < 10; ++i)
    {
        d.push_back(i);
    }

    printDeque(d);
    d.push_front(10);
    cout << d.size() << endl;
    // 没有容量

    // 排序
    d.push_front(100);
    d.push_front(20);
    d.push_front(200);

    for (int i = 10; i >= 0; --i)
    {
        d.push_back(i);
    }

    clock_t toc, tic;
    tic = clock();
    sort(d.begin(), d.end()); // 默认升序
    toc = clock();
    cout << "time" << ((double)(toc - tic))/CLOCKS_PER_SEC << endl;
    printDeque(d);
}

int main()
{
    test01();
}